<!DOCTYPE html>
<html>
<head>
<base href="${basePath}">
<meta charset="UTF-8">
<title>创建用户</title> $!{include("import_js_css.html")}
<link rel="stylesheet" type="text/css" href="${resourcePath}/css/basic.css" />
</head>
<body>
	$!{include("header.html")}
	<div class="menu_all">
		<div class="div_search_result clear">
			<div class="panel-heading panel-result-title">
				<h3 class="panel-title">创建用户</h3>
			</div>
			<div class="panel-form-add">
				<form class="form-horizontal" action="yueyogaAdmin/addBasicUser.jhtml" method="POST">
					<div class="panel-form-layout">
						<label for="txtUserName" class="col-sm-1 control-label">用户名</label>
						<div class="col-sm-3">
							<input type="text" class="form-control" name="username" required id="txtUserName" >
						</div>
						<label for="txtEmail" class="col-sm-1 control-label">邮箱</label>
						<div class="col-sm-3">
							<input type="text" style="background-color: #fff !important;" class="form-control panel-text-bg" name="email" id="txtEmail" value="" >
						</div>
						<br> <br>
						
						<label for="txtPassword" class="col-sm-1 control-label">密码</label>
						<div class="col-sm-3">
							<input type="password" style="background-color: #fff !important;" class="form-control panel-text-bg" name="password" required id="txtPassword" value="">
						</div>
						
						<label for="txtAgaPassword" class="col-sm-1 control-label">确认密码</label>
						<div class="col-sm-3">
							<input type="password" class="form-control" name="apassword" id="txtAgaPassword" value="" >
						</div>
						<br> <br>
						
						<label for="txtExpTime" class="col-sm-1 control-label">到期时间</label>
						<div class="col-sm-3">
							<div class='input-group date' id='txtExpTime' data-date-format="YYYY-MM-DD">
								<input name="expireTime" type='text' class="form-control" /> <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span> </span>
							</div>
						</div>
						<br> <br>
						<label for="txtExpTime" class="col-sm-1 control-label" style="margin-left:410px; margin-top:-35px;">所在会馆</label>
						<div class="col-sm-3" style="margin-top:-35px;margin-left:535px;">
							<select id="organization" name="organization" class="selectpicker" data-width="100%">
						  		<!--#var(Hall hall, List<Hall> halls)-->
						  		<!--#for(Hall hall:halls)-->
						  		<option value="${hall.code}">${hall.name}</option>
						  		<!--#end-->
						  	</select>
						</div>
						<br> <br>
						<hr width=98% size=1 style="border: 1 dashed" />
						<label for="txtName" class="col-sm-1 control-label">姓名</label>
						<div class="col-sm-3">
							<input type="text" class="form-control" name="name" id="txtName" value="">
						</div>
						<label for="inputSex" class="col-sm-1 control-label">性别</label>
						<div class="col-sm-4">
							<label class="radio-inline"> <!--#if(sex==null || sex=='男')--> <input type="radio" name="sex" value="男" checked="checked" >男 <!--#else--> <input type="radio" name="sex" value="男" >男 <!--#end-->
							</label> <label class="radio-inline"> <!--#if(sex=='女')--> <input type="radio" name="sex" value="女" checked="checked" >女 <!--#else--> <input type="radio" name="sex" value="女" >女 <!--#end-->
							</label>
						</div>
						<br> <br>
						
						<label for="inputBirthday" class="col-sm-1 control-label">出生日期</label>
						<div class="col-sm-3">
							<div class='input-group date' id='inputBirthday' data-date-format="YYYY-MM-DD">
								<input name="birthday" type='text' class="form-control" /> <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span> </span>
							</div>
						</div>
						<label for="txtPhone" class="col-sm-1 control-label">手机</label>
						<div class="col-sm-3">
							<input type="text" class="form-control" name="phone" id="txtPhone" value="">
						</div>
						<br> <br>
						
						<label for="txtAddress" class="col-sm-1 control-label">地址</label>
						<div class="col-sm-9">
							<textarea class="form-control panel-form-address" name="address" id="txtAddress"></textarea>
						</div>
						<br> <br>
						<br> <br>
						
						<div class="panel-btn-search">
							<button type="submit" class="btn btn-default btn-ade-default panel-mr">保存</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	function documentReady() {
		var groupMsg = "${msg}";
		if (groupMsg == "success") {
			var d = alert("添加成功");
			setTimeout(function() {
				d.close().remove();
				window.location.href = "yueyogaAdmin/searchBasicUsers.jhtml";
			}, 1000);
		} else if (groupMsg == "failure") {
			error("添加失败");
		}else if(groupMsg == "yizhuce"){
			alert("该用户已注册!");
		}else if(groupMsg == "notnull"){
			alert("用户名不能为空");
		}else if(groupMsg == "mimabuyizhi"){
			alert("两次密码输入不一致!");
		}else if(groupMsg == "mimanotnull"){
			alert("密码不能为空!");
		}else if(groupMsg == "email"){
			alert("邮箱已注册!");	
			return;
		}
	}
	$(function() {
		
		$("#organization").select2({
			width: "100%",
			minimumResultsForSearch: -1
		});
		
		$("#selTaskType").change(function() {
			var taskType = $(this).val();
			if (taskType == 2) {
				$("#ta_mbr_div").hide();
				$("#ta_gps_div").show();
			} else {
				$("#ta_gps_div").hide();
				$("#ta_mbr_div").show();
			}
		});
		//--
		$(".date").datetimepicker({
			language : "zh-CN",
			pickTime : false
		});
		
	});
</script>
</html>